n = 100000;
m = 99235;
print(str(n) + " " + str(m));
lst = 1;
sz = 2;
while lst + sz <= n:
	for i in range(sz - 1):
		print(str(lst) + " " + str(lst + 1), end = " ");
		lst += 1;
	lst += 1;
	sz += 1;
